﻿//-----------------------------------------------------------------------
// <copyright file="Program.cs" company="">
//     Copyright (c) Charles, . All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace ExcelMultipleFileFixer
{
    using System;
    using System.IO;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Runtime.InteropServices.ComTypes;

    /// <summary>
    /// Contains the program entry point.
    /// </summary>
    public static class Program
    {
        /// <summary>
        /// The main.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        [STAThread]
        private static void Main(string[] args)
        {
            string filename = null;
            if (args.Length > 0)
            {
                filename = args[0];
            }
            else if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Length > 0)
            {
                filename = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];
            }

            if (filename != null)
            {
                Utilities.OpenWithExcel(filename);
            }
        }
    }
}
